package cn.iocoder.yudao.module.system.dal.mysql.tenantdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.tenantdetail.TenantDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.tenantdetail.vo.*;

/**
 * 店铺详情 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface TenantDetailMapper extends BaseMapperX<TenantDetailDO> {

    default PageResult<TenantDetailDO> selectPage(TenantDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TenantDetailDO>()
                .eqIfPresent(TenantDetailDO::getMobile, reqVO.getMobile())
                .eqIfPresent(TenantDetailDO::getUserId, reqVO.getUserId())
                .likeIfPresent(TenantDetailDO::getName, reqVO.getName())
                .betweenIfPresent(TenantDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TenantDetailDO::getId));
    }

    default List<TenantDetailDO> selectList(TenantDetailExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<TenantDetailDO>()
                .eqIfPresent(TenantDetailDO::getMobile, reqVO.getMobile())
                .eqIfPresent(TenantDetailDO::getUserId, reqVO.getUserId())
                .likeIfPresent(TenantDetailDO::getName, reqVO.getName())
                .betweenIfPresent(TenantDetailDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TenantDetailDO::getId));
    }

}
